#!/bin/bash

# release on Kloxo 6.1.7
# by mustafa.ramadhan@lxcenter.org

# ENVIRONMENT VARIABLE PRIMER FOR REFERENCE
# $0 script invoked
# $1, $2, $3 are the command line arguments
# $# Number of command line arguments 
# $@ all command line arguments - white space is preserved
# $* all command line arguments - white space striped 

if [ "$#" == 0 ] || [ "$1" == "--help" ] ; then
	echo
	echo " ------------------------------------------------------------------------------"
	echo "  format:"
	echo "    sh $0 --engine=<> --database=[] --table=[] \\"
	echo "        --utf8=[] --config=[]"
	echo " ------------------------------------------------------------------------------"
	echo "  --engine - change to MyISAM/InnoDB"
	echo "  --database - database name; default: all databases"
	echo "  --table - table name; default: all tables"
	echo "  --utf8 - yes/no; default: no"
	echo "  --config - yes/no; default: yes"
	echo "      add on '/etc/my.cnf':"
	echo "         'default-storage-engine=[engine]', and"
	echo "         'skip-innodb' (for myisam)"
	echo
	echo "  Must be run separately on each server (master and slave)"
	exit;
fi

request1=$1
ENGINE=${request1#--engine\=}

if [ "$ENGINE" == "" ] ; then
	echo "Empty --engine= entry..."
	exit;
fi

. /script/directory
lxphp.exe ../bin/fix/mysql-convert.php $*
